package Client;
/**
 * This class represents a log file's lines 
 * Each line has a name and it's value
 * @author Group 6
 */
public class LogLine {

	private String name;
	private int value;

	/**
	 * Empty constructor
	 */
	public LogLine() {}
	
	/**
	 * @return the name of the line
	 */
	public String getName() {
		return name;
	}
	
	/**
	 * @param name of the line
	 * the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the value of the name
	 */
	public int getValue() {
		return value;
	}

	/**
	 * @param value of the name
	 * the value to set
	 */
	public void setValue(int value) {
		this.value = value;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "LogLine [name=" + name + ", value=" + value + "]";
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + value;
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof LogLine))
			return false;
		LogLine other = (LogLine) obj;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (value != other.value)
			return false;
		return true;
	}


}
